

 
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.webapp.WebAppContext;

public class JettyServer {

	private static int port = 8081; 
 
	public static void main(String[] args) {

		System.out.println("Jetty Server is starting...");

		Server server = new Server(port);
		SelectChannelConnector connector = new SelectChannelConnector();
		connector.setPort(port);
		server.addConnector(connector);

		WebAppContext webApp = new WebAppContext();
		webApp.setContextPath("/");
		webApp.setWar("src/main/webapp");
		server.setHandler(webApp);
		try {
			server.start();
			System.out.println("Jetty Server has started...");
			server.join();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	

}
